package edu.strategy.single.defaults;

import robocode.AdvancedRobot;
import robocode.Event;
import edu.strategy.single.Single;

public class ProjectMarsDefaultStrategy extends Single{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public ProjectMarsDefaultStrategy(AdvancedRobot advancedRobot) {
		super(advancedRobot);
	}

	@Override
	public void work() {
		super.used();
		if(super.getAdvancedRobot().getDistanceRemaining() != 0 && super.getAdvancedRobot().getTurnRemaining() != 0) {
			super.getAdvancedRobot().ahead(100);
			super.getAdvancedRobot().turnLeft(90);
			super.getAdvancedRobot().turnGunLeft(45);
			//super.getAdvancedRobot().execute();
			super.getAdvancedRobot().ahead(100);
			super.getAdvancedRobot().turnLeft(90);
			super.getAdvancedRobot().turnGunRight(90);
			//super.getAdvancedRobot().execute();
			/*super.getAdvancedRobot().setAhead(100);
			super.getAdvancedRobot().setTurnLeft(90);
			super.getAdvancedRobot().setTurnGunLeft(45);
			super.getAdvancedRobot().execute();
			super.getAdvancedRobot().setAhead(100);
			super.getAdvancedRobot().setTurnLeft(90);
			super.getAdvancedRobot().setTurnGunRight(90);
			super.getAdvancedRobot().execute();*/
		}
	}
	@Override
	public void prepare() {
		super.getAdvancedRobot().setAdjustGunForRobotTurn(false);
	}


	@Override
	public void work(Event e) {
		work();
	}

	@Override
	public String toString() {
		return "ProjectMarsDefaultStrategy";
	}

}
